﻿using CommunityToolkit.Mvvm;
using CommunityToolkit.Mvvm.ComponentModel;
using ProductMonitor.UserControls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;


namespace ProductMonitor.ViewModels
{
    public class MainWindowVM : ObservableObject //  NotifyPropertyChangedBase 实现了 INotifyPropertyChanged 接口
    {

       


    
        /// <summary>
        ///     监控用户控件
        /// </summary>
        private UserControl _MonitorUC;
        public UserControl MonitorUC
        {
            get 
            { 
                if(_MonitorUC == null)
                {
                     
                    _MonitorUC = new MonitorUC(); // 初始化 MonitorUC 为 MinitorUC 实例
                    
                }
                return _MonitorUC; // 返回 MonitorUC 的当前值
            }
            set
            {
                if (_MonitorUC != value)
                {
                    _MonitorUC = value;
                    OnPropertyChanged(nameof(MonitorUC)); // 使用基类
                }
                
            }
        }

    
    }
}
